<template>
  <ChatView
    title="AI 超级智能体"
    :sse-url="sseBase"
    :query-builder="buildUrl"
    :ai-avatar="aiAvatar"
    :append-newline-per-event="true"
    :back-to-home="true"
  />
</template>

<script setup lang="ts">
import ChatView from '../components/ChatView.vue'

// 后端为 SseEmitter 的接口也可使用 EventSource 直连（GET + queryString）
const sseBase = 'http://localhost:8123/api/ai/manus/chat'
const aiAvatar = '/favicon.ico'

function buildUrl(message: string) {
  const url = new URL(sseBase)
  url.searchParams.set('message', message)
  return url.toString()
}
</script>
